home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WFC010.ZIP / SRC / CWAIT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-03  |  1.1 KB  |  49 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like as long as you don't try to sell it.
  10. **
  11. ** Any attempt to sell WFC in source code form must have the permission
  12. ** of the original author. You can produce commercial executables with
  13. ** WFC but you can't sell WFC.
  14. **
  15. ** Copyright, 1995, Samuel R. Blackburn
  16. */
  17.  
  18. #if defined( _DEBUG )
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #define new DEBUG_NEW
  22. #endif
  23.  
  24. CWaitCursor::CWaitCursor( int cursor_number )
  25. {
  26.    if ( cursor_number == 0 )
  27.    {
  28.       AfxGetApp()->BeginWaitCursor();
  29.       m_PreviousCursorHandle = NULL;
  30.    }
  31.    else
  32.    {
  33.       HCURSOR cursor_handle = AfxGetApp()->LoadCursor( cursor_number );
  34.       m_PreviousCursorHandle = ::SetCursor( cursor_handle );
  35.    }
  36. }
  37.       
  38. CWaitCursor::~CWaitCursor()
  39. {
  40.    if ( m_PreviousCursorHandle == NULL )
  41.    {
  42.       AfxGetApp()->EndWaitCursor();
  43.    }
  44.    else
  45.    {
  46.       ::SetCursor( m_PreviousCursorHandle );
  47.    }
  48. }
  49.